<!DOCTYPE html>
<html>
<head>
    <title>文献管理</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="/statics/css/jquery.fileupload.css">
    <link rel="stylesheet" href="/statics/css/jquery.fileupload-ui.css">
    <link rel="stylesheet" href="/statics/css/bootstrap.min.css">
    <link rel="stylesheet" href="/statics/css/font-awesome.min.css">
    <link rel="stylesheet" href="/statics/plugins/jqgrid/ui.jqgrid-bootstrap.css">
    <link rel="stylesheet" href="/statics/plugins/ztree/css/metroStyle/metroStyle.css">
    <link rel="stylesheet" href="/statics/css/main.css">
    <script src="/statics/libs/jquery.min.js"></script>
    <script src="/statics/plugins/layer/layer.js"></script>
    <script src="/statics/libs/bootstrap.min.js"></script>
    <script src="/statics/libs/vue.min.js"></script>
    <script src="/statics/libs/validator.min.js"></script>
    <script src="/statics/plugins/jqgrid/grid.locale-cn.js"></script>
    <script src="/statics/plugins/jqgrid/jquery.jqGrid.min.js"></script>
    <script src="/statics/plugins/ztree/jquery.ztree.all.min.js"></script>
    <!--add validationEngine start 前端验证-->
    <link rel="stylesheet" href="/statics/plugins/validationEngine/validationEngine.jquery.css">
    <script src="/statics/plugins/validationEngine/jquery.validationEngine-zh_CN.js"></script>
    <script src="/statics/plugins/validationEngine/jquery.validationEngine-custom.js"></script>
    <script src="/statics/plugins/validationEngine/jquery.validationEngine.js"></script>
    <!--add validationEngine end-->
    <script src="/statics/js/init.js"></script><script src="/statics/js/common.js"></script>

    <script src="/statics/libs/jfu/jquery.ui.widget.js"></script>
    <script src="/statics/libs/jfu/jquery.iframe-transport.js"></script>
    <script src="/statics/libs/jfu/jquery.fileupload.js"></script>
    <style>
        .ui-jqgrid tr.jqgrow td { text-overflow : ellipsis; }
    </style>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <div class="form-group col-sm-2">
                <input type="text" class="form-control" v-model="q.title" @keyup.enter="query" placeholder="标题">
            </div>
            <a class="btn btn-default" @click="query">查询</a>
            <a v-if="hasPermission('orth:document:save')" class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
            <a v-if="hasPermission('orth:document:update')" class="btn btn-primary" @click="update"><i
                    class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
            <a v-if="hasPermission('orth:document:delete')" class="btn btn-primary" @click="del"><i
                    class="fa fa-trash-o"></i>&nbsp;删除</a>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">

            <div class="form-group">
                <div class="col-sm-2 control-label">文献类型</div>
                <div class="col-sm-10">
                    <select v-model="document.directionType" class="form-control">
                        <option v-for="item in items" v-bind:value="item.value">{{item.text}}</option>
                    </select>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">标题</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control validate[required,minSize[1],maxSize[500]]" v-model="document.title" placeholder="标题"/>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">发表日期</div>
                <div class="col-sm-10">
                    <input type="date" class="form-control validate[required]" v-model="document.publishTime" placeholder="发表日期"/>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">发表期刊</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control validate[required,minSize[1],maxSize[500]]" v-model="document.content" placeholder="发表期刊"/>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">作者</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control  validate[required,minSize[1],maxSize[500]]" v-model="document.updater" placeholder="作者"/>
                </div>
            </div>


            <div class="form-group">
                <div class="col-sm-2 control-label">文献摘要</div>
                <div class="col-sm-10">
                    <textarea style="height: 200px" class="form-control validate[required,minSize[1],maxSize[10000]]" v-model="document.digest" placeholder="文献摘要"></textarea>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">附件</div>
                <div class="col-sm-10">
                   	<span class="btn btn-success fileinput-button">
				<i class="glyphicon glyphicon-plus"></i>
				<span>上传附件</span>
				 <input type="file"  name="file" class="form-control"  id="attachment" onclick="uploadImage('#attachment','attachment')" placeholder="点击上传附件"/>
                    </span>
                    <span>{{attachment}}</span>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">备注字段</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control validate[optional,minSize[0],maxSize[500]]" v-model="document.json" placeholder="备注字段"/>
                </div>
            </div>



            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
</div>


<script src="/statics/js/modules/orth/document.js"></script>
</body>
</html>